import Detail from '@/views/Detail.vue'
import Login from '@/views/Login.vue'
import Register from '@/views/Register.vue'
import Layout from '@/views/Layout.vue'
import Vue from 'vue'
import VueRouter from 'vue-router'
import Article from '@/views/Article.vue'
import Collect from '@/views/Collect.vue'
import Like from '@/views/Like.vue'
import My from '@/views/My.vue'
Vue.use(VueRouter)
const router = new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/layout/article'
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/register',
      component: Register
    },
    {
      path: '/detail',
      component: Detail
    },
    {
      path: '/layout',
      component: Layout,
      children: [
        {
          path: '/layout/article',
          component: Article,
        },
        {
          path: '/layout/collect',
          component: Collect
        },
        {
          path: '/layout/like',
          component: Like
        },
        {
          path: '/layout/my',
          component: My
        },
      ]
    },
  ],
  mode: 'history'
})
export default router